package com.taoxi.system.service.impl;

import java.util.List;
import com.taoxi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.taoxi.system.mapper.ProjectMapper;
import com.taoxi.system.domain.Project;
import com.taoxi.system.service.IProjectService;

/**
 * 众筹Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-10
 */
@Service
public class ProjectServiceImpl implements IProjectService 
{
    @Autowired
    private ProjectMapper projectMapper;

    /**
     * 查询众筹
     * 
     * @param projectId 众筹主键
     * @return 众筹
     */
    @Override
    public Project selectProjectByProjectId(Long projectId)
    {
        return projectMapper.selectProjectByProjectId(projectId);
    }

    /**
     * 查询众筹列表
     * 
     * @param project 众筹
     * @return 众筹
     */
    @Override
    public List<Project> selectProjectList(Project project)
    {
        return projectMapper.selectProjectList(project);
    }

    /**
     * 新增众筹
     * 
     * @param project 众筹
     * @return 结果
     */
    @Override
    public int insertProject(Project project)
    {
        project.setCreateTime(DateUtils.getNowDate());
        return projectMapper.insertProject(project);
    }

    /**
     * 修改众筹
     * 
     * @param project 众筹
     * @return 结果
     */
    @Override
    public int updateProject(Project project)
    {
        project.setUpdateTime(DateUtils.getNowDate());
        return projectMapper.updateProject(project);
    }

    /**
     * 批量删除众筹
     * 
     * @param projectIds 需要删除的众筹主键
     * @return 结果
     */
    @Override
    public int deleteProjectByProjectIds(Long[] projectIds)
    {
        return projectMapper.deleteProjectByProjectIds(projectIds);
    }

    /**
     * 删除众筹信息
     * 
     * @param projectId 众筹主键
     * @return 结果
     */
    @Override
    public int deleteProjectByProjectId(Long projectId)
    {
        return projectMapper.deleteProjectByProjectId(projectId);
    }
}
